Developer Documentation

QuickTime 4 API Documentation

QuickTime Movie File Format Specification, May 1996

| Previous | Chapter contents | Chapter top | Next |

Track Reference Atoms

Track reference atoms define relationships between tracks. Track reference atoms allow tracks to specify their relationships to other tracks. For example, if a movie has three video tracks and three sound tracks, track references allow you to identify the related sound and video tracks. Track reference atoms have an atom type value of 'tref' .

Track references are uni-directional and point from the recipient track to the source track. For example, a video track may reference a time code track to indicate where its time code is stored, but the time code track would not reference the video track. The time code track is the source of time information for the video track.

A single track may reference multiple tracks. For example, a video track could reference a sound track to indicate that the two are synchronized and a time code track to indicate where its time code is stored.

A single track may also be referenced by multiple tracks. For example, both a sound and video track could reference the same time code track if they share the same timing information.

Figure 0-16 shows the layout of a track reference atom.

Figure 16 The layout of a track reference atom

A track reference atom contains the following data elements.

Size
A 32-bit integer that specifies the number of bytes in this track reference atom.
Type
A 32-bit integer that identifies the atom type; this field must be set to 'tref' .
Reference atoms
A list of track reference type atoms containing the track reference information. These atoms are described next.

Each track reference atom defines relationships with tracks of a specific type. The reference type implies a track type. Table 1-2 shows the track reference types and their descriptions.

Table 2 Track reference types 

Reference
type

Description

' tmcd '

Time code. Usually references a time code track.

' chap '

Chapter or scene list. Usually references a text track.

' sync '

Synchronization. Usually between a video and sound track. Indicates that the two tracks are synchronized. The reference can be from either track to the other, or there may be two references.

' scpt '

Transcript. Usually references a text track.

' ssrc '

Non-primary source. Indicates that the referenced track should send its data to this track, rather than presenting it. The referencing track will use the data to modify how it presents its data. See the next section, "Track Input Map Atoms," for more information.

Each track reference type atom contains the following data elements.

Size
A 32-bit integer that specifies the number of bytes in this track reference type atom.
Type
A 32-bit integer that identifies the atom type; this field must be set to one of the values shown in Table 0-2 .
Track IDs
A list of track ID values specifying the related tracks. Note that this is one case where track ID values may be set to 0. Unused entries in the atom may have a track ID value of 0. Setting the track ID to 0 may be more convenient that deleting the reference.

You can determine the number of track references stored in a track reference type atom by subtracting its header size from its overall size and then dividing by the size, in bytes, of a track ID.


© 1997 Apple Computer, Inc.

| Previous | Chapter contents | Chapter top | Next |